/*
 * Powered By [rapid-framework]
 * Web Site: http://www.rapid-framework.org.cn
 * Google Code: http://code.google.com/p/rapid-framework/
 * Since 2008 - 2011
 */

package com.dream.oproject.menu.model;

import javacommon.base.BaseEntity;

import javax.validation.constraints.Max;

import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;


/**
 * @author badqiu email:badqiu(a)gmail.com
 * @version 1.0
 * @since 1.0
 */


public class OpSystemMenu extends BaseEntity implements java.io.Serializable{
	private static final long serialVersionUID = 5454155825314635342L;
	
	//alias
	public static final String TABLE_ALIAS = "OpSystemMenu";
	public static final String ALIAS_UUID = "uuid";
	public static final String ALIAS_PARENT_MENU_ID = "parentMenuId";
	public static final String ALIAS_MENU_NAME = "menuName";
	public static final String ALIAS_DESCRIPTION = "description";
	public static final String ALIAS_SEQUENCE = "sequence";
	public static final String ALIAS_MEMU_LINK_ID = "memuLinkId";
	public static final String ALIAS_TARGET = "target";
	public static final String ALIAS_MENU_LEAVEL = "menuLeavel";
	
	//date formats
	
	//可以直接使用: @Length(max=50,message="用户名长度不能大于50")显示错误消息
	//columns START
    /**
     * uuid       db_column: uuid 
     */	
	
	private java.lang.Long uuid;
    /**
     * parentMenuId       db_column: parentMenuId 
     */	
	
	private java.lang.Long parentMenuId;
    /**
     * menuName       db_column: menuName 
     */	
	//@NotBlank @Length(max=50)
	private java.lang.String menuName;
    /**
     * description       db_column: description 
     */	
	//@Length(max=100)
	private java.lang.String description;
    /**
     * sequence       db_column: sequence 
     */	
	@Max(127)
	private Integer sequence;
    /**
     * memuLinkId       db_column: memuLinkId 
     */	
	
	private java.lang.Long memuLinkId;
    /**
     * target       db_column: target 
     */	
	//@Length(max=50)
	private java.lang.String target;
    /**
     * menuLeavel       db_column: menuLeavel 
     */	
	@Max(127)
	private Integer menuLeavel;
	//columns END

	public OpSystemMenu(){
	}

	public OpSystemMenu(
		java.lang.Long uuid
	){
		this.uuid = uuid;
	}

	public void setUuid(java.lang.Long value) {
		this.uuid = value;
	}
	
	public java.lang.Long getUuid() {
		return this.uuid;
	}
	public void setParentMenuId(java.lang.Long value) {
		this.parentMenuId = value;
	}
	
	public java.lang.Long getParentMenuId() {
		return this.parentMenuId;
	}
	public void setMenuName(java.lang.String value) {
		this.menuName = value;
	}
	
	public java.lang.String getMenuName() {
		return this.menuName;
	}
	public void setDescription(java.lang.String value) {
		this.description = value;
	}
	
	public java.lang.String getDescription() {
		return this.description;
	}
	public void setSequence(Integer value) {
		this.sequence = value;
	}
	
	public Integer getSequence() {
		return this.sequence;
	}
	public void setMemuLinkId(java.lang.Long value) {
		this.memuLinkId = value;
	}
	
	public java.lang.Long getMemuLinkId() {
		return this.memuLinkId;
	}
	public void setTarget(java.lang.String value) {
		this.target = value;
	}
	
	public java.lang.String getTarget() {
		return this.target;
	}
	public void setMenuLeavel(Integer value) {
		this.menuLeavel = value;
	}
	
	public Integer getMenuLeavel() {
		return this.menuLeavel;
	}

	public String toString() {
		return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
			.append("Uuid",getUuid())
			.append("ParentMenuId",getParentMenuId())
			.append("MenuName",getMenuName())
			.append("Description",getDescription())
			.append("Sequence",getSequence())
			.append("MemuLinkId",getMemuLinkId())
			.append("Target",getTarget())
			.append("MenuLeavel",getMenuLeavel())
			.toString();
	}
	
	public int hashCode() {
		return new HashCodeBuilder()
			.append(getUuid())
			.toHashCode();
	}
	
	public boolean equals(Object obj) {
		if(obj instanceof OpSystemMenu == false) return false;
		if(this == obj) return true;
		OpSystemMenu other = (OpSystemMenu)obj;
		return new EqualsBuilder()
			.append(getUuid(),other.getUuid())
			.isEquals();
	}
}

